﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity.Model;
using DAL;

namespace BLL
{
    public class DepartmentManagement : EntityManagement
    {
        /// <summary>
        /// 
        /// </summary>
        private DepartmentDAO departmentDao = new DepartmentDAO();

        /// <summary>
        /// load the department via the sys_user permission
        /// </summary>
        /// <param name="sUser"></param>
        /// <returns></returns>
        public List<Department> LoadDepartmentMenuTree(Sys_User sUser)
        {
            return this.departmentDao.LoadDepartmentMenuTree(sUser);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="d"></param>
        public void AddDepartment(Department d)
        {
            this.departmentDao.AddDepartment(d);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public Department GetDepartmentByName(Department dx)
        {
            return this.departmentDao.GetDepartmentByName(dx);
        }
    }
}
